<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 2、输入月份，显示当月的天数（使用case 穿透简化代码）
1-12 -->
    <script>
        var k1=10;
               switch(k1){
                case 1:
                case 3:
                case 5:
                case 7:
                case 8:
                case 10:
                case 12:
               console.log('31');
               break; 
               case 2:
              console.log('28');
              break; 
               case 4:
               case 6:
               case 9:
               case 11:
               console.log('30');
               break;
               default:
                    console.log('只有1-12');
                
               }   
    </script>
</body>
</html>